<div class="column-left">
  
  <h2 style="margin-bottom:7px;">Хайлтын үр дүн: <?php echo $keyword?></h2>
  <?php $selected = $sf_request->getParameter('selected', 'news')?>
  <div class="tabs" id="tabs-search">
      <div class="tab <?php if($selected == 'news') echo 'active'?>" id="tab-news">Мэдээ мэдээлэл</div>
      <div class="tab <?php if($selected == 'team') echo 'active'?>" id="tab-team">Багууд</div>
      <div class="tab <?php if($selected == 'player') echo 'active'?>" id="tab-player">Тоглогчид</div>
      <div class="tab <?php if($selected == 'photo') echo 'active'?>" id="tab-photo">Зураг</div>
      <div class="tab <?php if($selected == 'video') echo 'active'?>" id="tab-video">Видео</div>
      <hr class="separator"/>
      <div class="c <?php if($selected == 'news') echo 'active'?>" id="tab-news-c">
          <?php 
            $pagerNews = Doctrine::getTable('News')->getPager(array('keyword'=>$keyword), $page);
            include_partial('content/newslist', array('newss'=>$pagerNews->getResults()));
            echo pager($pagerNews, 'main/search?selected=news&searchinput='.$keyword)
          ?>
          <br clear="all">
      </div>
      <div class="c <?php if($selected == 'team') echo 'active'?>" id="tab-team-c">
          <?php 
            $pagerTeams = Doctrine::getTable('BbTeams')->getPager(array('keyword'=>(isset($keyword) ? $keyword : '')), $page);
            include_partial('team/teams', array('teams'=>$pagerTeams->getResults()));
            echo pager($pagerTeams, 'main/search?selected=team&searchinput='.$keyword)
          ?>
          <br clear="all">
      </div>
      <div class="c <?php if($selected == 'player') echo 'active'?>" id="tab-player-c">
          <?php            
            echo 'Нэрээр : &nbsp;';
            $letters = myConstants::getLetters();
            foreach ($letters as $letter)
                echo link_to($letter, 'main/search?selected=player&letter='.$letter, array()).' | ';
            echo link_to('Бүгд', 'main/search?selected=player', array());
            echo '<br clear="all">';
            
            echo 'Байрлалаар: &nbsp;';
            $positions = Doctrine::getTable('BbPositions')->createQuery('')->execute();
            foreach ($positions as $position)
                echo link_to($position, 'main/search?selected=player&positionId='.$position->getPId(), array()).' &nbsp; | &nbsp; ';
            echo link_to('Бүгд', 'main/search?selected=player', array());
            echo '<br clear="all">';

            $letter = $sf_request->getParameter('letter');
            $positionId = $sf_request->getParameter('positionId');
            $pagerPlayers = Doctrine::getTable('BbPlayers')->getPager(array('positionId'=>(isset($positionId) ? $positionId : ''), 'letter'=>(isset($letter) ? $letter : ''), 'keyword'=>(isset($keyword) ? $keyword : '')), array(), $page);
            
            include_partial('player/players', array('players'=>$pagerPlayers->getResults()));
            echo pager($pagerPlayers, 'main/search?selected=player&searchinput='.$keyword)
          ?>
          <br clear="all">
      </div>
      <div class="c <?php if($selected == 'photo') echo 'active'?>" id="tab-photo-c">
         <?php $photos = Doctrine::getTable('Image')->fetchall(array('keyword'=>(isset($keyword) ? $keyword : '')))?>
         <ul id="photos-search">
            <?php foreach ($photos as $photo):?>
              <li style="width:125px;height:110px;float:left;margin:2px;">
                <a href="<?php echo '/tlg13/uploads/gallery/'.$photo->getFullPath()?>" title="<?php echo $photo?>">
                  <?php echo image_tag('/uploads/gallery/'.$photo->getFullPath(120), array('alt'=>$photo, 'title'=>$photo, 'style'=>'max-width:120px;max-height:100px;border:1px solid #eee;padding:3px;'))?>
                </a>
              </li>
            <?php endforeach?>
          </ul>
          <br clear="all">
      </div>
      <div class="c <?php if($selected == 'video') echo 'active'?>" id="tab-video-c">
        	<?php include_partial('content/video', array('keyword'=>$keyword));?>
      </div>
  </div><!--tabs-->
    
</div>

<?php include_partial('main/right', array());?>

<br clear="all">

<?php include_partial('content/sponsors', array());?>

<br clear="all">


<script type="text/javascript">
$(function() {
	$('ul#photos-search a').lightBox();
});
</script>